//
// Created by mac on 1/28/22.
//


#include <vector>
using namespace std;

int singleNumber(vector<int>& nums) {
    int one = 0;
    int two = 0;
    for(int num:nums){
        one = (one ^ num) & ~two;
        two = (two ^ num) & ~one;

    }
    return one;

}